<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">











<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>NPanday - Executing Maven Goals</title>
    <style type="text/css" media="all">
      @import url("../../css/maven-base.css");
      @import url("../../css/maven-theme.css");
      @import url("../../css/site.css");
    </style>
    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
          </head>
  <body class="composite">
    <div id="banner">
                  <a href="" id="bannerLeft">
    
                                            <img src="../.././images/NPanday.png" alt="" />
    
            </a>
                        <a href="http://www.codeplex.com/" id="bannerRight">
    
                                            <img src="../.././images/logo-home.png" alt="" />
    
            </a>
            <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="breadcrumbs">
          
  

  
    
            
  
    
            <div class="xleft">
          
                <a href="http://npanday.codeplex.com/" class="externalLink">NPanday Home</a>
                &gt;
      
                <a href="../../">NPanday 1.2</a>
                  </div>
            <div class="xright">      
  

  
    
            
  
    
             Last Published: 22 Jun 2010
              &nbsp;| Version: 1.2
            </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="leftColumn">
      <div id="navcolumn">
           
  

  
    
            
  
    
                   <h5>General Info</h5>
            <ul>
              
    <li class="none">
                    <a href="../../index.html">NPanday Overview</a>
          </li>
              
    <li class="none">
                    <a href="../../release-notes.html">NPanday Release Notes</a>
          </li>
              
    <li class="none">
                    <a href="../../faqs.html">NPanday FAQs</a>
          </li>
              
    <li class="none">
                    <a href="../../faqs.html">NPanday Features</a>
          </li>
              
    <li class="none">
                    <a href="../../npanday.pdf">Documentation PDF</a>
          </li>
          </ul>
              <h5>User's Guide</h5>
            <ul>
              
    <li class="none">
                    <a href="../.././guide/index.html">Introduction</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/installation/index.html">Installation</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/vs/index.html">Visual Studio Add-in</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/maven/index.html">Maven Command Line</a>
          </li>
              
    <li class="none">
                    <a href="../.././guide/devinfra/index.html">Maven Development Infrastructure</a>
          </li>
              
    <li class="none">
                    <a href="../../plugins/index.html">NPanday Plugins</a>
          </li>
          </ul>
              <h5>Contributing</h5>
            <ul>
              
    <li class="none">
                    <a href="../.././developers/index.html">Developer's Guide</a>
          </li>
              
    <li class="none">
                    <a href="../.././issue-tracking.html">Issue Tracking</a>
          </li>
              
    <li class="none">
                    <a href="../.././mail-lists.html">Mailing Lists</a>
          </li>
          </ul>
              <h5>Project Documentation</h5>
            <ul>
              
                
              
      
            
      
            
      
            
      
            
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="../../project-info.html">Project Information</a>
                </li>
          </ul>
              <h5>Resources</h5>
            <ul>
              
    <li class="none">
                    <a href="http://maven.apache.org/" class="externalLink">Apache Maven</a>
          </li>
              
    <li class="none">
                    <a href="http://npanday.codeplex.com/" class="externalLink">NPanday on CodePlex</a>
          </li>
          </ul>
                                           <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
            <img alt="Built by Maven" src="../../images/logos/maven-feather.png"></img>
          </a>
                       
  

  
    
            
  
    
        </div>
    </div>
    <div id="bodyColumn">
      <div id="contentBox">
        <div class="section"><h2>Executing Maven Goals</h2>
<p>As we learned in the quick-start tutorial, it is possible to run Maven goals from within Visual Studio using NPanday. This section explores the concept of the build lifecycle in more detail.</p>
<div class="section"><h3>Compile</h3>
<p>In the Solution Explorer, right-click on the name of the project you want to compile, then select <tt>Current NPanday Project &gt; Build</tt> to build the selected project. Or, <tt>All NPanday Projects &gt; Build</tt> to build the parent and its sub-projects.</p>
<p><i>Note:</i> In some circumstances, Maven is currently unable to build (compile) without installing the project first. As a workaround, execute <tt>All NPanday Projects &gt; Install</tt> first before <tt>All NPanday Projects &gt; Build [compile]</tt>.</p>
<p>For projects with dependencies from remote repositories, the build might fail. As a workaround, re-import the project then, execute the build goal (<tt>Current&#160;NPanday&#160;Project&#160;&gt;&#160;Build</tt> or <tt>All&#160;NPanday&#160;Projects&#160;&gt;&#160;Build</tt>).</p>
<p>For projects with web references, a dialog box is prompted for updating the Web Services Description Language (<tt>wsdl</tt>). Click Yes to continue with the update, or, No to skip updating.</p>
<img src="../../images/vs/webservice_update.jpg" /><p>The NPanday .NET Build Tool performs the compile on the project and sends corresponding information to the Output window (including a message saying the build was successful). You can scroll up and down in the output window to display all the text.</p>
<p>You can also execute the normal Visual Studio build on your projects. To invoke Maven to perform <tt>build</tt>/<tt>install</tt>/<tt>test</tt>/<tt>clean</tt>, you must select the option from the All NPanday Projects or Current NPanday Project sub-menu.</p>
<p>When compiling a web application project, the NPanday .NET Build Tool performs an extra step by calling the <tt>Aspnet_compiler</tt> to validate the ASP section of the project. The Build Tool performs this step right after calling the CSharp compiler and Visual Basic compiler.</p>
</div>
<div class="section"><h3>Test</h3>
<p>To use the NPanday .NET Build Tool to test a Project:</p>
<ol type="1"><li>From the Solution Explorer, right-click on the name of the project you want to test, then select <tt>Current NPanday Project &gt; Test</tt> to perform the test to the selected project. Or, <tt>All NPanday Projects &gt; Test</tt> to perform the test to the parent project and its sub-projects.</li>
<li>The NPanday .NET Build Tool performs the tests on the project and sends corresponding information to the Output window (including a message saying the build was successful). You can scroll up and down in the output window to display all the text.</li>
</ol>
<p><b>Note</b>: When the test goal output result is not refreshed for C# test project, the project should be reimported, and the value of the test should also be changed. Then, perform <tt>Current&#160;Project:&#160;Test</tt> (or, <tt>All NPanday Projects &gt; Test</tt>).</p>
</div>
<div class="section"><h3>Install</h3>
<p>From the Solution Explorer, right-click on the name of the project you want to build, then select Current NPanday Project &gt; Install to install the selected project. Or, All NPanday Projects &gt; Install to install the parent project and its sub-projects.</p>
<p>The NPanday .NET Build Tool installs the artifacts into your local repository. For web projects with POM as packaging, the <tt>target</tt> directory is not created and only the parent <tt>pom.xml</tt> is put in the local repository which is the default behavior.</p>
<p>For web application projects, the project zip file is produced during this phase, specifically during the <tt>package</tt> phase.</p>
<p>Corresponding information is sent to the Output window (including a message saying the build was successful). You can scroll up and down in the output window to display all the text.</p>
<p>Next, verify the artifacts were placed into the .NET local repository under the following path: <tt> C:\Documents and Settings\[user_home]\.m2\uac\[gac_architecture]\artifactId\Version__GroupId </tt></p>
<p>For example: <tt> C:\Documents and Settings\[user_home]\.m2\uac\gac_msil\NPanday.Test\1.0__NPanday </tt></p>
<p>The following explains what each element in the path means:</p>
<ul><li><tt>[user_home]</tt> The user's home directory.</li>
<li><tt>gac_architecture</tt> The architecture type such as <tt>gac_msil</tt>, <tt>gac_32</tt>, etc.</li>
<li><tt>artifactId</tt> This is similar to the Maven <tt>artifactId</tt>. It is equivalent to the project's module name. In the example above, the artifactId is <tt>NPanday.Test</tt>.</li>
<li><tt>Version__GroupId</tt> The version of the artifact and the group it is in. In the example above the version is <tt>1.0</tt> and the GroupId is <tt>NPanday</tt>.</li>
</ul>
<p>The contents in C:\Documents and Settings\[user_home]\.m2\uac\gac_msil SHOULD NOT be manually modified or the project build will fail due to artifacts that are not properly indexed and are not synchronized with the repository. In case the contents have been modified, delete the C:\Documents and Settings\[user_home]\.m2\uac directory then re-install the project.</p>
<p>Finally, Verify that the following are also created under the following paths:</p>
<ul><li><tt>C:\Documents and Settings\[user_home]\.m2\pab</tt></li>
<li><tt>C:\Documents and Settings\[user_home]\.m2\npanday-settings.xml</tt></li>
</ul>
<p>Contents of npanday-settings.xml looks similar to the following:</p>
<div class="source"><pre>  &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;npandaySettings xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
    &lt;operatingSystem&gt;
      Microsoft Windows NT 5.1.2600 Service Pack 2
    &lt;/operatingSystem&gt;
    &lt;defaultSetup&gt;
      &lt;vendorName&gt;MICROSOFT&lt;/vendorName&gt;
      &lt;vendorVersion&gt;2.0.50727&lt;/vendorVersion&gt;
      &lt;frameworkVersion&gt;2.0.50727&lt;/frameworkVersion&gt;
    &lt;/defaultSetup&gt;
    &lt;vendors&gt;
      &lt;vendor&gt;
        &lt;vendorName&gt;MICROSOFT&lt;/vendorName&gt;
        &lt;vendorVersion&gt;1.1.4322&lt;/vendorVersion&gt;
        &lt;frameworks&gt;
          &lt;framework&gt;
          &lt;frameworkVersion&gt;1.1.4322&lt;/frameworkVersion&gt;
            &lt;installRoot&gt;
              C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
            &lt;/installRoot&gt;
          &lt;/framework&gt;
        &lt;/frameworks&gt;
      &lt;/vendor&gt;
      &lt;vendor&gt;
        &lt;vendorName&gt;MICROSOFT&lt;/vendorName&gt;
        &lt;vendorVersion&gt;2.0.50727&lt;/vendorVersion&gt;
        &lt;frameworks&gt;
          &lt;framework&gt;
          &lt;frameworkVersion&gt;2.0.50727&lt;/frameworkVersion&gt;
            &lt;installRoot&gt;
              C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
            &lt;/installRoot&gt;
            &lt;sdkInstallRoot&gt;
              C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\
            &lt;/sdkInstallRoot&gt;
          &lt;/framework&gt;
        &lt;/frameworks&gt;
      &lt;/vendor&gt;
    &lt;/vendors&gt;
  &lt;/npandaySettings&gt;</pre>
</div>
</div>
<div class="section"><h3>Clean</h3>
<p>To use the NPanday .NET Build Tool to clean a project (removes the <tt>target\ </tt> directory containing the files that were generated at build-time from the project's working directory):</p>
<ol type="1"><li>From the Solution Explorer, right-click on the name of the project you want to clean, then select Current NPanday Project &gt; Clean to clean the selected project. Or, All NPanday Projects &gt; Clean to perform the clean goal to the parent project and its sub-projects.</li>
<li>The NPanday .NET Build Tool performs the clean on the project and sends corresponding information to the Output window (including a message saying the build was successful). You can scroll up and down in the output window to display all the text.</li>
</ol>
</div>
<div class="section"><h3>NPanday's Maven Phase Algorithm</h3>
<p>Algorithm that differs the Visual Studio Execution from Console Command.</p>
<ol type="1"><li>All Project - Is triggered when the user right click in the solution explorer and select <tt>All NPanday Projects &gt; Build</tt> or <tt>All NPanday Projects &gt; Clean</tt> or <tt>All NPanday Projects &gt; Test</tt> or All NPanday Projects &gt; Install&gt;&gt;&gt;<ol type="A"><li>Save All Documents that are open in Visual Studio.</li>
<li>Retrieve the solution that is open in Visual Studio.</li>
<li>Loop through all the projects in the solution.</li>
<li>Check if it has a Web Reference, if it has it will update the Web Reference.</li>
<li>Execute the pom.xml of the solution may it be Build/Clean/Test/Install.</li>
</ol>
</li>
<li>Current Project - Is Triggered when the user right click in the solution explorer and select <tt>Current NPanday Project &gt; Build</tt> or <tt>Current NPanday Project &gt; Clean</tt> or <tt>Current NPanday Project &gt; Test</tt> or <tt>Current NPanday Project &gt; Install</tt><ol type="A"><li>Save All Documents that are open in Visual Studio.</li>
<li>Retrieve CURRENT pom.xml and CURRENT project.<ol type="a"><li>If pom.xml does not exist, set errorMsg to &quot;Pom Not Found&quot; Error.</li>
<li>If the packaging in the pom.xml is &quot;pom&quot;, set errorMsg to &quot;Pom may not be Project's Pom&quot; Error.</li>
</ol>
</li>
<li>Check if it has a Web Reference, if it has it will update the Web Reference.</li>
<li>Execute the pom.xml of the solution may it be Build/Clean/Test/Install.</li>
</ol>
</li>
</ol>
</div>
<div class="section"><h3>Summary</h3>
<p>Continue on to <a href="./assemblyKey.html"> Setting Assembly Keys</a>, or return to the <a href="./index.html"> index</a>.</p>
</div>
</div>

      </div>
    </div>
    <div class="clear">
      <hr/>
    </div>
    <div id="footer">
      <div class="xright">&#169;  
          2010
    
          NPanday
          
  

  
    
            
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
  </body>
</html>
